<@override name="title"><#if category['id']?? && category['id'] gt 0>编辑<#else>新建</#if>类型</@override>

<@override name="styles">
<link href='${ctx}/static/plugins/validation/validationEngine.jquery.css' rel='stylesheet' type='text/css'>
<link href='${ctx}/static/plugins/ztree/css/metroStyle/metroStyle.css' rel='stylesheet' type='text/css'>
</@override>


<@override name="header">
<h4>
    <ol class="breadcrumb">
        <li><a href="#"><i class="fa fa-map-marker"></i>&nbsp;&nbsp; 菜品管理</a></li>
        <li><a href="${ctx}/dishes/category">菜品类型</a></li>
        <li><a href="#"><#if category['id']?? && category['id'] gt 0>编辑<#else>新建</#if>类型</a></li>
    </ol>
</h4>
</@override>

<@override name="content">
<div class="row">
    <div class="col-xs-12">
        <form class="form-horizontal" action="${ctx}/dishes/category/save" method="post" role="form" id="data-form">
            <input type="hidden" value="${category.id!}" name="category.id" id="categoryId">

            <div class="panel panel-default">
                <div class="panel-heading"><h6 class="panel-title">菜品信息</h6></div>
                <div class="panel-body">
                    <#if message??>
                        <div class="alert alert-danger fade in widget-inner">
                            <button type="button" class="close" data-dismiss="alert">×</button>
                        ${message!}
                        </div>
                    </#if>

                    <div class="form-group">
                        <label class="col-sm-2 control-label text-right">名称:</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control validate[required]" name="category.name" value="${category.name!}">
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-2 control-label text-right">顺序:</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control validate[required,custom[integer]]" name="category.seq" value="${category.seq!}">
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-2 control-label text-right">描述:</label>
                        <div class="col-sm-10">
                            <textarea class="form-control" rows="3" name="category.description">${category.description!}</textarea>
                        </div>
                    </div>

                    <div class="form-actions text-center">
                        <input type="submit" id="submit" value="提交" class="btn btn-primary">
                    </div>

                </div>
            </div>
        </form>
    </div><!-- /.col -->
</div><!-- /.row -->
</@override>

<@override name="scripts">
<script type="text/javascript" src="${ctx}/static/plugins/ztree/jquery.ztree.all-3.5.js"></script>
<script type="text/javascript" src="${ctx}/static/plugins/ztree/ztree.js"></script>

<script type="text/javascript" src="${ctx}/static/plugins/validation/jquery.validationEngine.js"></script>
<script type="text/javascript" src="${ctx}/static/plugins/validation/jquery.validationEngine-zh_CN.js"></script>

<script type="text/javascript" src="${ctx}/static/views/dishes/category/item.js"></script>
</@override>

<@extends name="/WEB-INF/_basic/main.ftl"/>